<template>
 <h1>双向绑定指令</h1>
  <input type="text" v-model="info">
  {{info}}
  <hr>
  <h3>用户注册</h3>
  <input type="text" Placeholder="请输入用户名" v-model="user.name">
  <input type="text" Placeholder="请输入密码" v-model="user.pwd">
  <br>性别：
  <input type="radio" name="gender" value="1" v-model="user.gender">男
  <input type="radio" name="gender" value="0" v-model="user.gender">女
  <br>
  <button @click="f">点我注册</button>
</template>

<script setup>
  import {ref} from "vue";

  const info = ref('');
  const user = ref({
    name:'',pwd:'',gender:''
  })
  const f = ()=>{
    console.log(user.value,typeof user);
    console.log(user.value.name);
    console.log(user.value.pwd);
    console.log(user.value.gender);
  }
</script>

<style scoped>

</style>